package com.tgy;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/***
 * @ClassName: Servlet1
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 11:52 2021/12/20
 * @version : V1.0
 */
public class Servlet1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name = req.getParameter("name");
        System.out.println(name);
        req.getSession().setAttribute("name",name);
        resp.sendRedirect("Jsp/name.jsp");
    }
}
